﻿/**
 * Created by xjchen on 2020-03-19.
 * */

#ifndef MIDDLEWARE_SRIOREADER_H
#define MIDDLEWARE_SRIOREADER_H


#include "DeviceReader.h"
#include "AutoDetectReader.h"

class SrioReaderPrivate;

class SrioReader : public DeviceReader {
public:

    SrioReader(uint16_t channel);

    ~SrioReader();

    void setupConnection() override;

    int64_t onRead(char *buffer, int64_t len) override;

    uint16_t getChannel();

    void setOwner(AutoDetectReader *reader);

    void stop() override;

private:
    friend class SrioReaderPrivate;

    SrioReaderPrivate *srioReaderPrivate;
    int channel = 0;
    AutoDetectReader *owner = nullptr;
};


#endif /** MIDDLEWARE_SRIOREADER_H */
